<template>
  <div class="app-container">
   
    <el-tabs v-model="queryParams.auditType" type="card" @tab-click="getList">
      <el-tab-pane label="全部" name="9"></el-tab-pane>
      <!-- <el-tab-pane label="拒绝" name="0"></el-tab-pane> -->
      <el-tab-pane label="审核中" name="1"></el-tab-pane>
      <el-tab-pane label="待生产" name="2"></el-tab-pane>
      <el-tab-pane label="生产中" name="3"></el-tab-pane>
      <el-tab-pane label="生产暂停" name="4"></el-tab-pane>
      <el-tab-pane label="订单完工" name="5"></el-tab-pane>
      <el-tab-pane label="订单过期" name="6"></el-tab-pane>
      <el-tab-pane label="订单取消" name="7"></el-tab-pane>
    </el-tabs>
    <el-tabs v-model="queryParams.subAuditType" type="card" @tab-click="getList">
      <el-tab-pane label="待签发标准配比" name="1"></el-tab-pane>
      <el-tab-pane label="待签发开盘配比" name="2"></el-tab-pane>
      <el-tab-pane label="待审核开盘配比" name="3"></el-tab-pane>
      <el-tab-pane label="审核驳回" name="4"></el-tab-pane>
    </el-tabs>     
    <!-- 查询条件 -->
    <div class="queryParams-form-box" v-show="showSearch">
      <search-form-comp
        ref="searchformRef"
        :tabVal="queryParams.auditType"
        @handleAdd="handleAdd"
        @onSearchFunc="onSearchFunc"
        @generateTaskFn="generateTaskFn"
        :key="queryParams.auditType"
      />
    </div>

    <el-table
      v-loading="loading"
      :data="ordersList"
      @selection-change="handleSelectionChange"
      :key="queryParams.auditType"
      max-height="400"
    >
      <!-- 全部 -->
      <template v-if="queryParams.auditType == 9">
        <el-table-column
          show-overflow-tooltip
          align="center"
          fixed
          type="selection"
          width="55"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="70"
          prop="id"
          label="订单ID"
        ></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="订单来源">
          <template slot-scope="scope">
            <span v-if="scope.row.orderSource == 1">客户下单</span>
            <span v-if="scope.row.orderSource == 2">营销下单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderNumber"
          label="订单编号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderType"
          label="订单类型"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.orderType == 1">来料加工</span>
            <span v-if="scope.row.orderType == 2">普通订单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pay"
          label="是否预付款"
        >
          <template slot-scope="scope">{{
            scope.row.pay === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="startTime"
          label="计划开工时间"
          width="160"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="squareAmount"
          label="计划方量"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="engineeringName"
          label="工程名称"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="constructionUnit"
          label="施工单位"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="positionName"
          label="部位名称"
        >
          <template slot-scope="scope">{{
            scope.row.positionName | positionFilter
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pumpingName"
          label="泵送类型"
        >
          <template slot-scope="scope">
            {{ scope.row.pumpingId ? scope.row.pumpingName : "非泵送" }}
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="110"
          prop="primaryDesignatorId"
          label="主产品标号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="130"
          prop="additionalTitleIds"
          label="附加产品标号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="slump"
          label="塌落度"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="130"
          prop="transVolume"
          label="累计生产方量"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="accumulatedTrips"
          label="累计车次"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="totalPumpingVolume"
          label="累计泵浆"
        ></el-table-column>
        <!-- <el-table-column
          show-overflow-tooltip
          align="center"
          prop="contact"
          label="联系人"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="phone"
          label="联系方式"
        ></el-table-column> -->
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="customerId"
          label="客户ID"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="customerName"
          label="客户名称"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="customerPhone"
          label="客户联系方式"
          width="120"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="transport"
          label="运距"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="instructions"
          label="开工说明"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="address"
          label="施工地点"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="information"
          label="要求资料"
        >
          <template slot-scope="scope">{{
            scope.row.information === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="ds"
          label="是否冬施"
        >
          <template slot-scope="scope">
            <span v-if="+scope.row.ds == 1">是</span>
            <span v-else>是</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="updateTime"
          width="140"
          label="状态时间"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="auditType"
          label="订单状态"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.auditType == 0">拒绝</span>
            <span v-if="scope.row.auditType == 1">审核中</span>
            <span v-if="scope.row.auditType == 2">待生产</span>
            <span v-if="scope.row.auditType == 3">生产中</span>
            <span v-if="scope.row.auditType == 4">生产暂停</span>
            <span v-if="scope.row.auditType == 5">订单完工</span>
            <span v-if="scope.row.auditType == 6">订单过期</span>
            <span v-if="scope.row.auditType == 7">订单取消</span>
          </template>
        </el-table-column>
      </template>

      <!-- 拒绝 -->
      <template v-if="queryParams.auditType == 0">
        <el-table-column
          show-overflow-tooltip
          align="center"
          fixed
          type="selection"
          width="55"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="70"
          prop="id"
          label="订单ID"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="auditType"
          label="订单状态"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.auditType == 0">拒绝</span>
            <span v-if="scope.row.auditType == 1">审核中</span>
            <span v-if="scope.row.auditType == 2">待生产</span>
            <span v-if="scope.row.auditType == 3">生产中</span>
            <span v-if="scope.row.auditType == 4">生产暂停</span>
            <span v-if="scope.row.auditType == 5">订单完工</span>
            <span v-if="scope.row.auditType == 6">订单过期</span>
            <span v-if="scope.row.auditType == 7">订单取消</span>
          </template>
        </el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="订单来源">
          <template slot-scope="scope">
            <span v-if="scope.row.orderSource == 1">客户下单</span>
            <span v-if="scope.row.orderSource == 2">营销下单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderNumber"
          label="订单编号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderType"
          label="订单类型"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.orderType == 1">来料加工</span>
            <span v-if="scope.row.orderType == 2">普通订单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pay"
          label="是否预付款"
        >
          <template slot-scope="scope">{{
            scope.row.pay === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="startTime"
          label="计划开工时间"
          width="160"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="squareAmount"
          label="计划方量"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="engineeringName"
          label="工程名称"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="constructionUnit"
          label="施工单位"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="positionName"
          label="部位名称"
        >
          <template slot-scope="scope">{{
            scope.row.positionName | positionFilter
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pumpingName"
          label="泵送类型"
        >
          <template slot-scope="scope">
            {{ scope.row.pumpingId ? scope.row.pumpingName : "非泵送" }}
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="110"
          prop="primaryDesignatorId"
          label="主产品标号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="130"
          prop="additionalTitleIds"
          label="附加产品标号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="slump"
          label="塌落度"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="130"
          prop="transVolume"
          label="累计生产方量"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="accumulatedTrips"
          label="累计车次"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="totalPumpingVolume"
          label="累计泵浆"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="contact"
          label="联系人"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="phone"
          label="联系方式"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="transport"
          label="运距"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="instructions"
          label="开工说明"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="address"
          label="施工地点"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="information"
          label="要求资料"
        >
          <template slot-scope="scope">{{
            scope.row.information === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="ds"
          label="是否冬施"
        >
          <template slot-scope="scope">
            <span v-if="+scope.row.ds == 1">是</span>
            <span v-else>是</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="updateTime"
          width="140"
          label="状态时间"
        ></el-table-column>
      </template>

      <!-- 审核中的列-->
      <template v-if="queryParams.auditType == '1'">
        <el-table-column
          show-overflow-tooltip
          align="center"
          fixed
          type="selection"
          width="55"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="70"
          prop="id"
          label="订单ID"
        ></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="订单来源">
          <template slot-scope="scope">
            <span v-if="scope.row.orderSource == 1">客户下单</span>
            <span v-if="scope.row.orderSource == 2">营销下单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderNumber"
          label="订单编号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderType"
          label="订单类型"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.orderType == 1">来料加工</span>
            <span v-if="scope.row.orderType == 2">普通订单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pay"
          label="是否预付款"
        >
          <template slot-scope="scope">{{
            scope.row.pay === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="订单状态">
          <template slot-scope="scope">
            <span v-if="scope.row.auditType == 0">拒绝</span>
            <span v-if="scope.row.auditType == 1">审核中</span>
            <span v-if="scope.row.auditType == 2">待生产</span>
            <span v-if="scope.row.auditType == 3">生产中</span>
            <span v-if="scope.row.auditType == 4">生产暂停</span>
            <span v-if="scope.row.auditType == 5">订单完工</span>
            <span v-if="scope.row.auditType == 6">订单过期</span>
            <span v-if="scope.row.auditType == 7">订单取消</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="110"
          prop="primaryDesignatorId"
          label="主产品标号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="130"
          prop="additionalTitleIds"
          label="附加产品标号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="startTime"
          label="计划开工时间"
          width="160"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="squareAmount"
          label="计划方量"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="positionName"
          label="部位名称"
        >
          <template slot-scope="scope">{{
            scope.row.positionName | positionFilter
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          label="泵送类型"
        >
          <template slot-scope="scope">
            {{ scope.row.pumpingId ? scope.row.pumpingName : "非泵送" }}
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="slump"
          label="塌落度"
        ></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="是否超方">
          <template slot-scope="scope">{{
            scope.row.supersquare === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="information"
          label="要求资料"
        >
          <template slot-scope="scope">{{
            scope.row.information === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="ds"
          label="是否冬施"
        >
          <template slot-scope="scope">
            <span v-if="+scope.row.ds == 1">是</span>
            <span v-else>是</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="deliveryTpye"
          label="配送方式"
        >
          <template slot-scope="scope">{{
            scope.row.deliveryTpye === 0 ? "需配送" : "自提"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="engineeringName"
          label="工程名称"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="constructionUnit"
          label="施工单位"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="transport"
          label="运距"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="instructions"
          label="开工说明"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="address"
          label="施工地点"
        ></el-table-column>
        <!-- <el-table-column
          show-overflow-tooltip
          align="center"
          prop="contact"
          label="联系人"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="phone"
          label="联系方式"
        ></el-table-column> -->
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="customerId"
          label="客户ID"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="customerName"
          label="客户名称"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="customerPhone"
          label="客户联系方式"
          width="120"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="createTime"
          label="下单时间"
          width="160"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          fixed="right"
          label="操作"
          width="160"
        >
          <template slot-scope="scope">
            <template v-if="scope.row.auditType == 0">
              <el-button
                style="margin-left: 10px"
                type="text"
                size="small"
                @click="handleUpdate(scope.row)"
                >修改</el-button
              >
            </template>
            <template v-else>
              <el-popconfirm
                title="确认审核通过吗"
                @confirm="auditPassFunc(scope.row.id)"
              >
                <el-button type="text" size="small" slot="reference"
                  >审核通过</el-button
                >
              </el-popconfirm>
              <el-button
                style="margin-left: 10px"
                type="text"
                size="small"
                @click="(approvedOpen = true), (selectRowId = scope.row.id)"
                >审核驳回</el-button
              >
            </template>
          </template>
        </el-table-column>
      </template>

      <!-- 待生产的列 -->
      <template v-if="queryParams.auditType == '2'">
        <el-table-column
          show-overflow-tooltip
          align="center"
          fixed
          type="selection"
          width="55"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="70"
          prop="id"
          label="订单ID"
        ></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="订单来源">
          <template slot-scope="scope">
            <span v-if="scope.row.orderSource == 1">客户下单</span>
            <span v-if="scope.row.orderSource == 2">营销下单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderNumber"
          label="订单编号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderType"
          label="订单类型"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.orderType == 1">来料加工</span>
            <span v-if="scope.row.orderType == 2">普通订单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pay"
          label="是否预付款"
        >
          <template slot-scope="scope">{{
            scope.row.pay === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderStatus"
          label="订单状态"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.auditType == 0">拒绝</span>
            <span v-if="scope.row.auditType == 1">审核中</span>
            <span v-if="scope.row.auditType == 2">待生产</span>
            <span v-if="scope.row.auditType == 3">生产中</span>
            <span v-if="scope.row.auditType == 4">生产暂停</span>
            <span v-if="scope.row.auditType == 5">订单完工</span>
            <span v-if="scope.row.auditType == 6">订单过期</span>
            <span v-if="scope.row.auditType == 7">订单取消</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="startTime"
          label="计划开工时间"
          width="160"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="squareAmount"
          label="计划方量"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="positionName"
          label="部位名称"
        >
          <template slot-scope="scope">{{
            scope.row.positionName | positionFilter
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pumpingName"
          label="泵送类型"
        >
          <template slot-scope="scope">
            {{ scope.row.pumpingId ? scope.row.pumpingName : "非泵送" }}
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="slump"
          label="塌落度"
        ></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="是否超方">
          <template slot-scope="scope">{{
            scope.row.supersquare === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="information"
          label="要求资料"
        >
          <template slot-scope="scope">{{
            scope.row.information === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="ds"
          label="是否冬施"
        >
          <template slot-scope="scope">
            <span v-if="+scope.row.ds == 1">是</span>
            <span v-else>是</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="deliveryTpye"
          label="配送方式"
        >
          <template slot-scope="scope">{{
            scope.row.deliveryTpye === 0 ? "需配送" : "自提"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="110"
          prop="primaryDesignatorId"
          label="主产品标号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="130"
          prop="additionalTitleIds"
          label="附加产品标号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="engineeringName"
          label="工程名称"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="constructionUnit"
          label="施工单位"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="transport"
          label="运距"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="instructions"
          label="开工说明"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="address"
          label="施工地点"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="updateTime"
          label="状态时间"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          fixed="right"
          label="操作"
          width="160"
        >
          <!-- <template slot-scope="scope"> -->
          <!-- <el-button type="text" size="small">签发标准配比</el-button>
            <el-button type="text" size="small">修改配比</el-button> -->
          <!-- </template> -->
        </el-table-column>
      </template>

      <!-- 生产中的列 -->
      <template v-if="queryParams.auditType == '3'">
        <el-table-column
          show-overflow-tooltip
          align="center"
          fixed
          type="selection"
          width="55"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="70"
          prop="id"
          label="订单ID"
        ></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="订单来源">
          <template slot-scope="scope">
            <span v-if="scope.row.orderSource == 1">客户下单</span>
            <span v-if="scope.row.orderSource == 2">营销下单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderNumber"
          label="订单编号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderType"
          label="订单类型"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.orderType == 1">来料加工</span>
            <span v-if="scope.row.orderType == 2">普通订单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pay"
          label="是否预付款"
        >
          <template slot-scope="scope">{{
            scope.row.pay === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderStatus"
          label="订单状态"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.auditType == 0">拒绝</span>
            <span v-if="scope.row.auditType == 1">审核中</span>
            <span v-if="scope.row.auditType == 2">待生产</span>
            <span v-if="scope.row.auditType == 3">生产中</span>
            <span v-if="scope.row.auditType == 4">生产暂停</span>
            <span v-if="scope.row.auditType == 5">订单完工</span>
            <span v-if="scope.row.auditType == 6">订单过期</span>
            <span v-if="scope.row.auditType == 7">订单取消</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="engineeringName"
          label="工程名称"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="constructionUnit"
          label="施工单位"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="transport"
          label="运距"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="instructions"
          label="开工说明"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="address"
          label="施工地点"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="130"
          prop="transVolume"
          label="累计生产方量"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="startTime"
          label="计划开工时间"
          width="160"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="squareAmount"
          label="计划方量"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="positionName"
          label="部位名称"
        >
          <template slot-scope="scope">{{
            scope.row.positionName | positionFilter
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pumpingName"
          label="泵送类型"
        >
          <template slot-scope="scope">
            {{ scope.row.pumpingId ? scope.row.pumpingName : "非泵送" }}
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="slump"
          label="塌落度"
        ></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="是否超方">
          <template slot-scope="scope">{{
            scope.row.supersquare === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="information"
          label="要求资料"
        >
          <template slot-scope="scope">{{
            scope.row.information === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="ds"
          label="是否冬施"
        >
          <template slot-scope="scope">
            <span v-if="+scope.row.ds == 1">是</span>
            <span v-else>是</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="deliveryTpye"
          label="配送方式"
        >
          <template slot-scope="scope">{{
            scope.row.deliveryTpye === 0 ? "需配送" : "自提"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="accumulatedTrips"
          label="累计车次"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="totalPumpingVolume"
          label="累计泵浆"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          width="100"
          align="center"
          prop="standardMixRatio"
          label="标准配比数据"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          width="100"
          align="center"
          prop="openingMixRatio"
          label="开盘配比数据"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="updateTime"
          label="状态时间"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          fixed="right"
          label="操作"
          width="160"
        >
          <template slot-scope="scope">
            <!-- <el-button type="text" size="small">查看配比</el-button> -->
            <el-button type="text" size="small" @click="viewTongDan(scope.row)"
              >查看砼单</el-button
            >
          </template>
        </el-table-column>
      </template>

      <!-- 生产暂停 -->
      <template v-if="queryParams.auditType == '4'">
        <el-table-column
          show-overflow-tooltip
          align="center"
          fixed
          type="selection"
          width="55"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="70"
          prop="id"
          label="订单ID"
        ></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="订单来源">
          <template slot-scope="scope">
            <span v-if="scope.row.orderSource == 1">客户下单</span>
            <span v-if="scope.row.orderSource == 2">营销下单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderNumber"
          label="订单编号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderType"
          label="订单类型"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.orderType == 1">来料加工</span>
            <span v-if="scope.row.orderType == 2">普通订单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pay"
          label="是否预付款"
        >
          <template slot-scope="scope">{{
            scope.row.pay === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderStatus"
          label="订单状态"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.auditType == 0">拒绝</span>
            <span v-if="scope.row.auditType == 1">审核中</span>
            <span v-if="scope.row.auditType == 2">待生产</span>
            <span v-if="scope.row.auditType == 3">生产中</span>
            <span v-if="scope.row.auditType == 4">生产暂停</span>
            <span v-if="scope.row.auditType == 5">订单完工</span>
            <span v-if="scope.row.auditType == 6">订单过期</span>
            <span v-if="scope.row.auditType == 7">订单取消</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="startTime"
          label="计划开工时间"
          width="160"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="squareAmount"
          label="计划方量"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="positionName"
          label="部位名称"
        >
          <template slot-scope="scope">{{
            scope.row.positionName | positionFilter
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pumpingName"
          label="泵送类型"
        >
          <template slot-scope="scope">
            {{ scope.row.pumpingId ? scope.row.pumpingName : "非泵送" }}
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="slump"
          label="塌落度"
        ></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="是否超方">
          <template slot-scope="scope">{{
            scope.row.supersquare === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="information"
          label="要求资料"
        >
          <template slot-scope="scope">{{
            scope.row.information === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="ds"
          label="是否冬施"
        >
          <template slot-scope="scope">
            <span v-if="+scope.row.ds == 1">是</span>
            <span v-else>是</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="deliveryTpye"
          label="配送方式"
        >
          <template slot-scope="scope">{{
            scope.row.deliveryTpye === 0 ? "需配送" : "自提"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="130"
          prop="transVolume"
          label="累计生产方量"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="accumulatedTrips"
          label="累计车次"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="totalPumpingVolume"
          label="累计泵浆"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="updateTime"
          label="暂停时间"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="updateTime"
          width="140"
          label="状态时间"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          fixed="right"
          label="操作"
          width="200"
        >
          <template slot-scope="scope">
            <el-popconfirm title="确认开工吗" @confirm="handleOrder(scope.row)">
              <el-button type="text" size="small" slot="reference"
                >开工</el-button
              >
            </el-popconfirm>
            <!-- <el-button type="text" size="small">查看配比</el-button> -->
            <el-button type="text" size="small" @click="viewTongDan(scope.row)"
              >查看砼单</el-button
            >
          </template>
        </el-table-column>
      </template>
      <!-- 订单完工 -->
      <template v-if="queryParams.auditType == '5'">
        <el-table-column
          show-overflow-tooltip
          align="center"
          fixed
          type="selection"
          width="55"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="70"
          prop="id"
          label="订单ID"
        ></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="订单来源">
          <template slot-scope="scope">
            <span v-if="scope.row.orderSource == 1">客户下单</span>
            <span v-if="scope.row.orderSource == 2">营销下单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderNumber"
          label="订单编号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderType"
          label="订单类型"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.orderType == 1">来料加工</span>
            <span v-if="scope.row.orderType == 2">普通订单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pay"
          label="是否预付款"
        >
          <template slot-scope="scope">{{
            scope.row.pay === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderStatus"
          label="订单状态"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.auditType == 0">拒绝</span>
            <span v-if="scope.row.auditType == 1">审核中</span>
            <span v-if="scope.row.auditType == 2">待生产</span>
            <span v-if="scope.row.auditType == 3">生产中</span>
            <span v-if="scope.row.auditType == 4">生产暂停</span>
            <span v-if="scope.row.auditType == 5">订单完工</span>
            <span v-if="scope.row.auditType == 6">订单过期</span>
            <span v-if="scope.row.auditType == 7">订单取消</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="startTime"
          label="计划开工时间"
          width="160"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="squareAmount"
          label="计划方量"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="positionName"
          label="部位名称"
        >
          <template slot-scope="scope">{{
            scope.row.positionName | positionFilter
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pumpingName"
          label="泵送类型"
        >
          <template slot-scope="scope">
            {{ scope.row.pumpingId ? scope.row.pumpingName : "非泵送" }}
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="slump"
          label="塌落度"
        ></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="是否超方">
          <template slot-scope="scope">{{
            scope.row.supersquare === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="information"
          label="要求资料"
        >
          <template slot-scope="scope">{{
            scope.row.information === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="ds"
          label="是否冬施"
        >
          <template slot-scope="scope">
            <span v-if="+scope.row.ds == 1">是</span>
            <span v-else>是</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="deliveryTpye"
          label="配送方式"
        >
          <template slot-scope="scope">{{
            scope.row.deliveryTpye === 0 ? "需配送" : "自提"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="130"
          prop="transVolume"
          label="累计生产方量"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="accumulatedTrips"
          label="累计车次"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="totalPumpingVolume"
          label="累计泵浆"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="updateTime"
          label="状态时间"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          fixed="right"
          label="操作"
          width="180"
        >
          <template slot-scope="scope">
            <el-button type="text" size="small" @click="lookDetails(scope.row)"
              >详情</el-button
            >
            <!-- <el-button type="text" size="small">查看配比</el-button> -->
            <el-button type="text" size="small" @click="viewTongDan(scope.row)"
              >查看砼单</el-button
            >
          </template>
        </el-table-column>
      </template>

      <!-- 订单过期 -->
      <template v-if="queryParams.auditType == '6'">
        <el-table-column
          show-overflow-tooltip
          align="center"
          fixed
          type="selection"
          width="55"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="70"
          prop="id"
          label="订单ID"
        ></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="订单来源">
          <template slot-scope="scope">
            <span v-if="scope.row.orderSource == 1">客户下单</span>
            <span v-if="scope.row.orderSource == 2">营销下单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderNumber"
          label="订单编号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderType"
          label="订单类型"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.orderType == 1">来料加工</span>
            <span v-if="scope.row.orderType == 2">普通订单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pay"
          label="是否预付款"
        >
          <template slot-scope="scope">{{
            scope.row.pay === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderStatus"
          label="订单状态"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.auditType == 0">拒绝</span>
            <span v-if="scope.row.auditType == 1">审核中</span>
            <span v-if="scope.row.auditType == 2">待生产</span>
            <span v-if="scope.row.auditType == 3">生产中</span>
            <span v-if="scope.row.auditType == 4">生产暂停</span>
            <span v-if="scope.row.auditType == 5">订单完工</span>
            <span v-if="scope.row.auditType == 6">订单过期</span>
            <span v-if="scope.row.auditType == 7">订单取消</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="startTime"
          label="计划开工时间"
          width="160"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="squareAmount"
          label="计划方量"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="positionName"
          label="部位名称"
        >
          <template slot-scope="scope">{{
            scope.row.positionName | positionFilter
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pumpingName"
          label="泵送类型"
        >
          <template slot-scope="scope">
            {{ scope.row.pumpingId ? scope.row.pumpingName : "非泵送" }}
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="slump"
          label="塌落度"
        ></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="是否超方">
          <template slot-scope="scope">{{
            scope.row.supersquare === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="information"
          label="要求资料"
        >
          <template slot-scope="scope">{{
            scope.row.information === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="ds"
          label="是否冬施"
        >
          <template slot-scope="scope">
            <span v-if="+scope.row.ds == 1">是</span>
            <span v-else>是</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="deliveryTpye"
          label="配送方式"
        >
          <template slot-scope="scope">{{
            scope.row.deliveryTpye === 0 ? "需配送" : "自提"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="130"
          prop="transVolume"
          label="累计生产方量"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="accumulatedTrips"
          label="累计车次"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="totalPumpingVolume"
          label="累计泵浆"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="updateTime"
          label="状态时间"
        ></el-table-column>
      </template>

      <!-- 订单取消 -->
      <template v-if="queryParams.auditType == '7'">
        <el-table-column
          show-overflow-tooltip
          align="center"
          fixed
          type="selection"
          width="55"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="70"
          prop="id"
          label="订单ID"
        ></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="订单来源">
          <template slot-scope="scope">
            <span v-if="scope.row.orderSource == 1">客户下单</span>
            <span v-if="scope.row.orderSource == 2">营销下单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderNumber"
          label="订单编号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderType"
          label="订单类型"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.orderType == 1">来料加工</span>
            <span v-if="scope.row.orderType == 2">普通订单</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pay"
          label="是否预付款"
        >
          <template slot-scope="scope">{{
            scope.row.pay === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="orderStatus"
          label="订单状态"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.auditType == 0">拒绝</span>
            <span v-if="scope.row.auditType == 1">审核中</span>
            <span v-if="scope.row.auditType == 2">待生产</span>
            <span v-if="scope.row.auditType == 3">生产中</span>
            <span v-if="scope.row.auditType == 4">生产暂停</span>
            <span v-if="scope.row.auditType == 5">订单完工</span>
            <span v-if="scope.row.auditType == 6">订单过期</span>
            <span v-if="scope.row.auditType == 7">订单取消</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="110"
          prop="primaryDesignatorId"
          label="主产品标号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="130"
          prop="additionalTitleIds"
          label="附加产品标号"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="startTime"
          label="计划开工时间"
          width="160"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="squareAmount"
          label="计划方量"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="positionName"
          label="部位名称"
        >
          <template slot-scope="scope">{{
            scope.row.positionName | positionFilter
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          width="90"
          prop="pumpingName"
          label="泵送类型"
        >
          <template slot-scope="scope">
            {{ scope.row.pumpingId ? scope.row.pumpingName : "非泵送" }}
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="slump"
          label="塌落度"
        ></el-table-column>
        <el-table-column show-overflow-tooltip align="center" label="是否超方">
          <template slot-scope="scope">{{
            scope.row.supersquare === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="information"
          label="要求资料"
        >
          <template slot-scope="scope">{{
            scope.row.information === 0 ? "否" : "是"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="ds"
          label="是否冬施"
        >
          <template slot-scope="scope">
            <span v-if="+scope.row.ds == 1">是</span>
            <span v-else>是</span>
          </template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="deliveryTpye"
          label="配送方式"
        >
          <template slot-scope="scope">{{
            scope.row.deliveryTpye === 0 ? "需配送" : "自提"
          }}</template>
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="engineeringName"
          label="工程名称"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="constructionUnit"
          label="施工单位"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="transport"
          label="运距"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="instructions"
          label="开工说明"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="address"
          label="施工地点"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="customerId"
          label="客户ID"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="customerName"
          label="客户名称"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="customerContact"
          label="客户联系方式"
        ></el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="cancelTime"
          label="取消时间"
        ></el-table-column>
      </template>
    </el-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <el-dialog
      title="审核驳回原因"
      :visible.sync="approvedOpen"
      width="500px"
      :close-on-click-modal="false"
      append-to-body
    >
      <el-form ref="form">
        <el-form-item label-width="0px">
          <el-input
            v-model="auditReason"
            type="textarea"
            placeholder="请输入内容"
            show-word-limit
            rows="6"
            :maxlength="99"
          />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitauditReason">确 定</el-button>
        <el-button @click="approvedOpen = false">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 添加或修改客户订单对话框 -->
    <el-dialog
      :title="title"
      :visible.sync="open"
      width="1200px"
      append-to-body
      :close-on-click-modal="false"
    >
      <el-form
        :disabled="IsLookDetails"
        ref="form"
        label-position="left"
        :model="form"
        :rules="rules"
        label-width="80px"
      >
        <!-- <el-card>
          <div>
            <div>审核未通过 这里是审核时间yyyy-mm-dd hh：mm：ss</div>
            <div>未通过原因：这里是未通过原因</div>
          </div>
        </el-card> -->

        <el-card>
          <div slot="header" class="clearfix">
            <span>客户信息</span>
          </div>

          <el-row>
            <el-col :span="6">
              <el-form-item
                :rules="[
                  {
                    validator,
                    trigger: 'change',
                  },
                ]"
                label="工程"
                required
                prop="engineeringId"
              >
                <div style="display: flex; gap: 20px; align-items: center">
                  <span v-if="form.engineeringId">{{
                    form.engineeringName
                  }}</span>
                  <el-button type="text" @click="dialogVisible = true">{{
                    form.engineeringId ? "请重新选择" : "请选择"
                  }}</el-button>
                </div>
              </el-form-item>
            </el-col>
            <el-col v-if="form.engineeringId" :offset="2" :span="6">
              <el-form-item label="工程ID">
                {{ form.engineeringId }}
              </el-form-item>
            </el-col>
            <el-col v-if="form.engineeringId" :offset="2" :span="6">
              <el-form-item label-width="80" label="工程付款人">
                {{ form.payerName }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row v-if="form.engineeringId">
            <el-col :span="6">
              <el-form-item label="客户名称">
                {{ form.customUserName }}
              </el-form-item>
            </el-col>
            <el-col :offset="2" :span="6">
              <el-form-item label="客户类型">
                <span v-if="form.userProperty == 3">企业</span>
                <span v-if="form.userProperty == 4">个人</span>
              </el-form-item>
            </el-col>
            <el-col :offset="2" :span="6">
              <el-form-item label="客户ID">
                {{ form.customUserId }}
              </el-form-item>
            </el-col>
          </el-row>
          <el-row v-if="form.engineeringId">
            <el-col :span="6">
              <el-form-item label="合同编号">
                {{
                  form.contract ? form.contract.projectNo : "该工程无合同信息"
                }}
              </el-form-item>
            </el-col>
          </el-row>
        </el-card>

        <el-card style="margin-top: 10px">
          <div slot="header" class="clearfix">
            <span>订单信息</span>
          </div>
          <el-row>
            <el-col :span="7">
              <el-form-item
                label="订单类型"
                :rules="[
                  { required: true, message: '请选择', trigger: 'change' },
                ]"
                prop="orderType"
              >
                <el-select v-model="form.orderType" placeholder="请选择">
                  <el-option label="来料加工" :value="1"></el-option>
                  <el-option label="普通订单" :value="2"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col
              v-if="primaryDesignatorList.length > 0"
              :offset="1"
              :span="7"
            >
              <el-form-item
                :rules="[
                  { required: true, message: '请选择', trigger: 'change' },
                ]"
                label="主产品标号"
                label-width="100px"
                prop="primaryDesignatorId"
              >
                <el-select
                  v-model="form.primaryDesignatorId"
                  placeholder="请选择"
                >
                  <el-option
                    v-for="item in primaryDesignatorList"
                    :key="item.id"
                    :label="item.primaryDesignatorName"
                    :value="item.id"
                  >
                  </el-option>
                </el-select>

                <!-- <div style="display: flex; gap: 20px; align-items: center">
                  <span v-if="form.primaryDesignatorId">{{
                    form.primaryDesignatorName
                  }}</span>
                  <el-button
                    type="text"
                    @click="primaryDesignatorIdVisible = true"
                    >{{
                      form.primaryDesignatorId ? "请重新选择" : "请选择"
                    }}</el-button
                  >
                </div> -->
              </el-form-item>
            </el-col>
            <el-col v-if="additionalTitleList.length > 0" :offset="1" :span="7">
              <el-form-item
                label="附加产品标号"
                label-width="100px"
                prop="additionalTitleIds"
              >
                <!-- <div style="display: flex; gap: 20px; align-items: center">
                  <span v-if="form.additionalTitleIds">{{
                    form.additionalTitleNames
                  }}</span>
                  <el-button
                    type="text"
                    @click="additionalTitleIdsVisible = true"
                    >{{
                      form.additionalTitleIds ? "请重新选择" : "请选择"
                    }}</el-button
                  >
                </div> -->
                <el-select
                  multiple
                  v-model="form.additionalTitleIds"
                  placeholder="请选择"
                >
                  <el-option
                    v-for="item in additionalTitleList"
                    :key="item.id"
                    :label="item.additionalTitleName"
                    :value="item.id"
                  >
                  </el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="7">
              <el-form-item
                label="部位名称"
                :rules="[
                  { required: true, message: '请选择', trigger: 'change' },
                ]"
                prop="positionName"
              >
                <el-select v-model="form.positionName" placeholder="请选择">
                  <el-option label="墙柱" :value="1"></el-option>
                  <el-option label="筏板" :value="2"></el-option>
                  <el-option label="梁板梯" :value="3"></el-option>
                  <el-option label="梁板柱" :value="4"></el-option>
                  <el-option label="垫层" :value="5"></el-option>
                  <el-option label="路面" :value="6"></el-option>
                  <el-option label="基础承台" :value="7"></el-option>
                  <el-option label="平" :value="8"></el-option>
                  <el-option label="屋面找平" :value="9"></el-option>
                  <el-option label="屋面保护" :value="10"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :offset="1" :span="7">
              <el-form-item
                label="泵送类型"
                :rules="[
                  { required: true, message: '请选择', trigger: 'change' },
                ]"
                prop="pumpingId"
              >
                <el-select v-model="form.pumpingId" placeholder="请选择">
                  <el-option label="非泵送" value="非泵送"></el-option>
                  <el-option
                    v-for="item in pumpingList"
                    :key="item.id"
                    :label="item.pumpingName"
                    :value="item.id"
                  ></el-option>
                </el-select>
                <!-- <div style="display: flex; gap: 20px; align-items: center">
                  <span v-if="form.pumpingId">{{ form.pumpingName }}</span>
                  <el-button type="text" @click="pumpingIdVisible = true">{{
                    form.pumpingId ? "请重新选择" : "请选择"
                  }}</el-button>
                </div> -->
              </el-form-item>
            </el-col>
            <el-col :offset="1" :span="7">
              <el-form-item label="塌落度" prop="slump">
                <el-select v-model="form.slump" placeholder="请选择">
                  <el-option label="100" value="100"></el-option>
                  <el-option label="120" value="120"></el-option>
                  <el-option label="130" value="130"></el-option>
                  <el-option label="140" value="140"></el-option>
                  <el-option label="150" value="150"></el-option>
                  <el-option label="150-180" value="150-180"></el-option>
                  <el-option label="160" value="160"></el-option>
                  <el-option label="170" value="170"></el-option>
                  <el-option label="180" value="180"></el-option>
                  <el-option label="190" value="190"></el-option>
                  <el-option label="200" value="200"></el-option>
                  <el-option label="210" value="210"></el-option>
                  <el-option label="220" value="220"></el-option>
                  <el-option label="230" value="230"></el-option>
                  <el-option label="240" value="240"></el-option>
                  <el-option label="150±30" value="150±30"></el-option>
                  <el-option label="160-200" value="160-200"></el-option>
                  <el-option label="150-210" value="150-210"></el-option>
                  <el-option label="180-190" value="180-190"></el-option>
                  <el-option label="180-200" value="180-200"></el-option>
                  <el-option label="180-210" value="180-210"></el-option>
                  <el-option label="180-220" value="180-220"></el-option>
                  <el-option label="180-240" value="180-240"></el-option>
                  <el-option label="40-70" value="40-70"></el-option>
                  <el-option label="50-60" value="50-60"></el-option>
                  <el-option label="70-90" value="70-90"></el-option>
                  <el-option label="220±20" value="220±20"></el-option>
                  <el-option label="150±20" value="150±20"></el-option>
                  <el-option label="150±10" value="150±10"></el-option>
                  <el-option label="170±20" value="170±20"></el-option>
                  <el-option label="210±10" value="210±10"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="7">
              <el-form-item
                label="计划开工时间"
                label-width="120px"
                :rules="[
                  { required: true, message: '请选择', trigger: 'change' },
                ]"
                prop="startTime"
              >
                <el-date-picker
                  v-model="form.startTime"
                  type="datetime"
                  placeholder="选择日期"
                  value-format="yyyy-MM-dd HH:mm:ss"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :offset="1" :span="7">
              <el-form-item
                label="计划方量"
                :rules="[
                  { required: true, message: '请填写', trigger: 'blur' },
                ]"
                prop="squareAmount"
              >
                <el-input
                  v-model="form.squareAmount"
                  type="number"
                  placeholder="请填写"
                />
              </el-form-item>
            </el-col>
            <el-col :offset="1" :span="7">
              <el-form-item label="浇筑部位" prop="pouringSite">
                <el-input v-model="form.pouringSite" placeholder="请填写" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="7">
              <el-form-item
                label="现场联系人"
                label-width="120px"
                :rules="[
                  { required: true, message: '请填写', trigger: 'blur' },
                ]"
                prop="contact"
              >
                <el-input v-model="form.contact" placeholder="请填写" />
              </el-form-item>
            </el-col>
            <el-col :offset="1" :span="7">
              <el-form-item
                label="手机号"
                :rules="[
                  { required: true, message: '请填写', trigger: 'blur' },
                  {
                    pattern: /^1[3456789]\d{9}$/,
                    message: '请填写正确手机号',
                    trigger: 'blur',
                  },
                ]"
                prop="phone"
              >
                <el-input v-model="form.phone" placeholder="请填写" />
              </el-form-item>
            </el-col>
            <el-col :offset="1" :span="7">
              <el-form-item
                label="第二联系方式"
                label-width="120px"
                prop="phoneTwo"
              >
                <el-input v-model="form.phoneTwo" placeholder="请填写" />
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="7">
              <el-form-item
                label="先款后货"
                :rules="[
                  { required: true, message: '请选择', trigger: 'change' },
                ]"
                prop="pay"
              >
                <el-radio-group v-model="form.pay">
                  <el-radio :label="1">是</el-radio>
                  <el-radio :label="0">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :offset="1" :span="7">
              <el-form-item
                label="是否冬施"
                :rules="[
                  { required: true, message: '请选择', trigger: 'change' },
                ]"
                prop="ds"
              >
                <el-radio-group v-model="form.ds">
                  <el-radio :label="1">是</el-radio>
                  <el-radio :label="0">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="7">
              <el-form-item
                label="允许超方"
                :rules="[
                  { required: true, message: '请选择', trigger: 'change' },
                ]"
                prop="supersquare"
              >
                <el-radio-group v-model="form.supersquare">
                  <el-radio :label="1">是</el-radio>
                  <el-radio :label="0">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :offset="1" :span="7">
              <el-form-item
                label="要求资料"
                :rules="[
                  { required: true, message: '请选择', trigger: 'change' },
                ]"
                prop="information"
              >
                <el-radio-group v-model="form.information">
                  <el-radio :label="1">是</el-radio>
                  <el-radio :label="0">否</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
            <el-col :offset="1" :span="7">
              <el-form-item
                label="配送方式"
                :rules="[
                  { required: true, message: '请选择', trigger: 'change' },
                ]"
                label-width="120px"
                prop="deliveryTpye"
              >
                <el-radio-group v-model="form.deliveryTpye">
                  <el-radio :label="1">自提</el-radio>
                  <el-radio :label="0">需配送</el-radio>
                </el-radio-group>
              </el-form-item>
            </el-col>
          </el-row>
          <el-form-item
            label-width="180px"
            :rules="[{ required: true, message: '请填写', trigger: 'blur' }]"
            label="开工说明及技术要求"
            prop="instructions"
          >
            <el-input
              v-model="form.instructions"
              type="textarea"
              placeholder="请输入内容"
            />
          </el-form-item>
          <el-form-item label="备注" prop="remark">
            <el-input
              v-model="form.remark"
              type="textarea"
              placeholder="请输入内容"
            />
          </el-form-item>
        </el-card>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 砼单列表 -->
    <el-dialog
      title="砼单列表"
      :visible="tongDanList.length > 0"
      @update:visible="tongDanList = []"
      width="1200px"
      append-to-body
      :close-on-click-modal="false"
    >
      <el-table :data="tongDanList" style="width: 100%">
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="id"
          label="砼单id"
          width="180"
        >
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="concreteNo"
          label="砼单编号"
          width="180"
        >
        </el-table-column>
        <el-table-column
          show-overflow-tooltip
          align="center"
          prop="concreteStatus"
          label="砼单状态"
        >
          <template slot-scope="scope">
            <span v-if="scope.row.concreteStatus == 3">生产中</span>
            <span v-if="scope.row.concreteStatus == 4">已签收</span>
          </template>
        </el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <!-- <el-button type="primary" @click="submitForm">确 定</el-button> -->
        <el-button @click="tongDanList = []">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 选择工程弹窗 -->
    <SelectEngineeringDialog
      :dialogVisible="dialogVisible"
      :multiple="false"
      @onClose="dialogVisible = false"
      @onSubmit="handleOnSubmit"
    ></SelectEngineeringDialog>

    <!-- 主产品标号 -->
    <SelectMainDialog
      :dialogVisible="primaryDesignatorIdVisible"
      :multiple="false"
      @onClose="primaryDesignatorIdVisible = false"
      @onSubmit="handlePrimaryDesignatorSubmit"
    ></SelectMainDialog>

    <!-- 泵送类型 -->
    <SelectPumpingDialog
      :dialogVisible="pumpingIdVisible"
      :multiple="false"
      @onClose="pumpingIdVisible = false"
      @onSubmit="handlePumpingIdVisibleSubmit"
    ></SelectPumpingDialog>

    <!-- 附加标号 -->
    <SelectSubMainDialog
      :dialogVisible="additionalTitleIdsVisible"
      :multiple="true"
      :defauleValues="selectSubMains"
      @onClose="additionalTitleIdsVisible = false"
      @onSubmit="handleAdditionalTitleIdsVisibleSubmit"
    ></SelectSubMainDialog>
  </div>
</template>

<script>
import {
  listOrders,
  getOrders,
  delOrders,
  addOrders,
  updateOrders,
  checkReview_API,
  listById,
  orderInfo,
} from "@/api/service/orderCenter/custom";
import { getContract } from "@/api/service/marketing/contract";
import { getEngineering } from "@/api/service/marketing/engineering.js";
import { productionPlan } from "@/api/service/orderCenter/automaticScheduling";
import searchFormComp from "./searchFormComp.vue";
import SelectEngineeringDialog from "@/components/SelectDialog/SelectEngineeringDialog";
import SelectMainDialog from "@/components/SelectDialog/SelectMainDialog";
import SelectSubMainDialog from "@/components/SelectDialog/SelectSubMainDialog";
import SelectPumpingDialog from "@/components/SelectDialog/SelectPumpingDialog";
import utils from "@/utils/columnFilter.js";
import { listPumping } from "@/api/service/config-center/pumping";
export default {
  name: "Orders",
  components: {
    searchFormComp,
    SelectEngineeringDialog,
    SelectMainDialog,
    SelectSubMainDialog,
    SelectPumpingDialog,
  },
  data() {
    return {
      IsLookDetails: false,
      pumpingIdVisible: false,
      additionalTitleIdsVisible: false,
      primaryDesignatorIdVisible: false,
      dialogVisible: false,

      selectRowId: "", //当前选择的列id
      auditReason: "", //驳回理由
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 客户订单表格数据
      ordersList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 20,
        auditType: "9",
        subAuditType: "1",
      },
      // 表单参数
      form: {
        orderSource: "2",
      },
      // 表单校验
      rules: {},
      selectedRows: [],
      approvedOpen: false,

      tongDanList: [],
      additionalTitleList: [],
      primaryDesignatorList: [],

      pumpingList: [],
      // test使用
      activeName: 'first',
      activeName2: 'second1',
      lineLeft: 0,
      lineWidth: 100, // 初始宽度假设为100px
    };
  },
  created() {
    this.$nextTick(() => {
      this.$refs.subTabs.$el.querySelector(".el-tabs__active-bar").style.width = "68px";
    });
  },
  filters: {
    positionFilter: utils.positionFilter,
  },
  async created() {
    this.getList();
    const res = await listPumping({ enable: true });
    this.pumpingList = res.data;
  },
  computed: {
    selectSubMains() {
      if (this.form.additionalTitleIds && this.form.additionalTitleNames) {
        const ids = this.form.additionalTitleIds.split(",");
        const names = this.form.additionalTitleNames.split(",");
        return ids.map((id, index) => ({
          id,
          name: names[index],
        }));
      }
      return [];
    },
  },
  methods: {  
    lookDetails(row) {
      this.open = true;
      this.title = "查看客户订单";
      this.form = row;
      this.IsLookDetails = true;
    },
    validator(_, value, callback) {
      if (!value) {
        callback(new Error("请选择工程"));
      } else {
        callback();
      }
    },
    handleAdditionalTitleIdsVisibleSubmit(arr) {
      this.form.additionalTitleIds = arr.map((item) => item.id).join(",");
      this.form.additionalTitleNames = arr.map((item) => item.name).join(",");
    },
    handlePumpingIdVisibleSubmit(row) {
      this.form.pumpingName = row.pumpingName;
      this.form.pumpingId = row.id;
    },
    handlePrimaryDesignatorSubmit(row) {
      this.form.primaryDesignatorName = row.name;
      this.form.primaryDesignatorId = row.id;
    },
    async handleOnSubmit(row) {
      this.form.engineeringId = row.id;
      this.form.engineeringName = row.name;

      this.form.payerName = row.payerName;
      this.form.customUserId = row.customUserId;
      this.form.customUserName = row.customUserName;
      this.form.userProperty = row.userProperty;
      this.form.contract = row.contract;
      this.$refs["form"].validateField("engineeringId");
      if (row.contract?.id) {
        const res = await getContract(row.contract.id);
        this.primaryDesignatorList = res.data.primaryDesignatorList;
        this.additionalTitleList = res.data.additionalTitleList;
      } else {
        this.primaryDesignatorList = [];
        this.additionalTitleList = [];
        this.form.primaryDesignatorId = "";
        this.form.additionalTitleIds = "";
      }
    },
    reviewRejection(row) {
      this.reset();
      const id = row.id || this.ids;
      this.form.id = id;
      this.form.auditType = 0;
      this.approvedOpen = true;
    },
    // 审核通过
    async approved(row) {
      updateOrders({
        id: row.id,
        auditType: 2,
      }).then((response) => {
        this.$modal.msgSuccess("审核通过");
        this.getList();
      });
    },
    /** 查询客户订单列表 */
    getList() {
      console.log('11111');
      
      this.loading = true;
      let postData = {
        ...this.queryParams,
      };
      if (this.$refs["searchformRef"]) {
        let searchformData = this.$refs["searchformRef"].getSearchformData(
          this.queryParams.auditType
        ); //获取表单数据
        postData = {
          ...this.queryParams,
          ...searchformData,
        };
      }

      if (postData.auditType == 9) postData.auditType = null;

      listOrders(postData)
        .then((response) => {
          this.ordersList = response.rows;
          this.total = response.total;
          this.loading = false;
        })
        .finally(() => {
          this.loading = false;
        });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
      this.IsLookDetails = false;
    },
    // 表单重置
    reset() {
      this.primaryDesignatorList = [];
      this.additionalTitleList = [];
      this.form = {
        id: null,
        engineeringId: null,
        engineeringName: null,
        orderType: null,
        primaryDesignatorId: null,
        primaryDesignatorName: null,
        additionalTitleIds: null,
        additionalTitleNames: null,
        pumpingName: null,
        positionName: null,
        pumpingId: null,
        slump: null,
        startTime: null,
        squareAmount: null,
        pouringSite: null,
        contact: null,
        phone: null,
        phoneTwo: null,
        pay: null,
        ds: null,
        supersquare: null,
        information: null,
        deliveryTpye: null,
        instructions: null,
        auditType: null,
        auditReason: null,
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null,
        orderSource: "2",
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    //搜索条件的请求
    onSearchFunc(_data) {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.id);
      this.single = selection.length !== 1;
      this.multiple = !selection.length;
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "新增客户订单";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      const id = row.id || this.ids;
      getOrders(id)
        .then(({ data }) => {
          this.form = data;
          return new Promise((resolve) => {
            getEngineering(data.engineeringId).then((res) => {
              resolve(res);
            });
          });
        })
        .then(
          ({
            data: {
              payerName,
              customUserName,
              userProperty,
              customUserId,
              contract = {},
              name,
            },
          }) => {
            this.form = {
              ...this.form,
              payerName,
              customUserName,
              userProperty,
              customUserId,
              contract: {
                projectNo: contract.projectNo,
              },
              engineeringName: name,
            };
            console.log(this.form);
            this.open = true;
            this.title = "修改客户订单";
          }
        );
    },
    /** 提交按钮 */
    async submitForm() {
      if (this.IsLookDetails) {
        this.IsLookDetails = false;
        this.open = false;
        return;
      }
      await this.$refs["form"].validate();
      if (Array.isArray(this.form.additionalTitleIds)) {
        this.form.additionalTitleIds = this.form.additionalTitleIds?.join(",");
      }
      const pumpingId = this.form.pumpingId;
      if (this.form.id != null) {
        updateOrders({
          ...this.form,
          pumpingId: pumpingId === "非泵送" ? "" : pumpingId,
        }).then((response) => {
          this.$modal.msgSuccess("修改成功");
          this.open = false;
          this.approvedOpen = false;
          this.getList();
        });
      } else {
        addOrders({
          ...this.form,
          pumpingId: pumpingId === "非泵送" ? "" : pumpingId,
        }).then((response) => {
          this.$modal.msgSuccess("新增成功");
          this.open = false;
          this.getList();
        });
      }
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal
        .confirm('是否确认删除客户订单编号为"' + ids + '"的数据项？')
        .then(function () {
          return delOrders(ids);
        })
        .then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        })
        .catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download(
        "system/orders/export",
        {
          ...this.queryParams,
        },
        `orders_${new Date().getTime()}.xlsx`
      );
    },
    //提交审核驳回。
    submitauditReason() {
      if (!this.auditReason.trim())
        return this.$message.error("请填写审核拒绝理由");
      let postData = {
        auditType: 0,
        auditReason: this.auditReason,
        ordersId: this.selectRowId,
      };
      checkReview_API(postData).then((res) => {
        if (res.code == 200) {
          this.$message.success(res.msg || "提交成功!");
          this.approvedOpen = false;
          this.auditReason = "";
          //刷新列表
          this.getList();
        }
      });
    },
    // 开工
    handleOrder(row) {
      updateOrders({
        id: row.id,
        auditType: 3,
      }).then((response) => {
        this.$modal.msgSuccess("修改成功");
        this.getList();
      });
    },
    // 加入生产任务
    generateTaskFn() {
      if (!this.ids.length) return this.$message.error("请先勾选待开工的订单");
      // 弹出确认操作
      this.$confirm(`确认加入生产计划吗?`, `已选${this.ids.length}个订单`, {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          productionPlan({
            orderIds: this.ids,
            time: utils.getTodayDateWithTime(),
          }).then((res) => {
            this.$message.success("加入生产任务成功!");
            this.getList();
          });
        })
        .catch(() => {
          this.$message.info("取消加入生产计划");
        });
    },
    // 查看砼单
    async viewTongDan(row) {
      const res = await listById(row.id);
      if (res.data.concreteInfoDataList.length == 0) {
        this.$message.warning("该订单没有砼单数据！");
        return;
      }
      this.tongDanList = res.data.concreteInfoDataList;
    },
    //审核通过
    auditPassFunc(_id) {
      let postData = {
        auditType: 2,
        // auditReason: "",
        ordersId: _id,
      };
      checkReview_API(postData).then((res) => {
        if (res.code == 200) {
          this.$message.success(res.msg || "提交成功!");
          this.approvedOpen = false;
          this.auditReason = "";
          //刷新列表
          this.getList();
        }
      });
    },
  },
};
</script>

<style lang="scss" scoped>
::v-deep .el-tabs__content {
  max-height: 400px;
  overflow: auto;
}
::v-deep .el-dialog__body {
  max-height: 700px;
  overflow: auto;
}
::v-deep .el-tabs--card > .el-tabs__header .el-tabs__item.is-active {
    border-bottom-color: #FFFFFF !important;
}
::v-deep .el-tabs--card > .el-tabs__header .el-tabs__item {
  border-bottom: 2px solid transparent;
}
</style>
